
URL ="http://code.google.com/p/cental-desktop-managment/"
Wscript.Echo "" & URL
Set WshShell = WScript.CreateObject("WScript.Shell")

Set http = CreateObject("MSXML2.XmlHttp")
http.open "GET", URL , FALSE
http.setRequestHeader "Content-Type","'application/soap+xml; charset=utf-8"
http.setRequestHeader "Content-Length", "255"
'data=http.setRequestHeader( "vipul", "Value" )
http.send ""
Wscript.Echo "http readyState" & http.readyState
Wscript.Echo "http status " & http.status
Wscript.Echo "http response " & http.responseText

kill process by filename
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
    ("SELECT * FROM Win32_Process WHERE Name = 'explorer.exe'")
For Each objProcess in colProcessList
    objProcess.Terminate()
Next

system variable
strVarName = "FOOBAR"
strVarValue = "Foobar Value"

Set objVarClass = GetObject( "winmgmts://./root/cimv2:Win32_Environment" )
Set objVar      = objVarClass.SpawnInstance_
objVar.Name          = strVarName
objVar.VariableValue = strVarValue
objVar.UserName      = "<SYSTEM>"
objVar.Put_
WScript.Echo "Created environment variable " & strVarName
Set objVar      = Nothing
Set objVarClass = Nothing


list of environment variable
Set objWMIService = GetObject( "winmgmts://./root/CIMV2" )
strQuery = "SELECT * FROM Win32_Environment WHERE Name='TEMP'"
Set colItems = objWMIService.ExecQuery( strQuery, "WQL", 48 )

For Each objItem In colItems
 	WScript.Echo "Caption        : " & objItem.Caption
 	WScript.Echo "Description    : " & objItem.Description
 	WScript.Echo "Name           : " & objItem.Name
 	WScript.Echo "Status         : " & objItem.Status
 	WScript.Echo "SystemVariable : " & objItem.SystemVariable
	WScript.Echo "UserName       : " & objItem.UserName
	WScript.Echo "VariableValue  : " & objItem.VariableValue
	WScript.Echo
Next

Set colItems      = Nothing
Set objWMIService = Nothing

List user Environment Variables

Set wshShell = CreateObject( "WScript.Shell" )
Set wshUserEnv = wshShell.Environment( "USER" )
For Each strItem In wshUserEnv
	WScript.Echo strItem
Next
Set wshUserEnv = Nothing
Set wshShell   = Nothing

download file at specific location
HTTPDownload "http://www.robvanderwoude.com/files/wmigen.zip", "C:\"

Sub HTTPDownload( myURL, myPath )
' This Sub downloads the FILE specified in myURL to the path specified in myPath.
'
' myURL must always end with a file name
' myPath may be a directory or a file name; in either case the directory must exist
'
' Written by Rob van der Woude
' http://www.robvanderwoude.com
'
' Based on a script found on the Thai Visa forum
' http://www.thaivisa.com/forum/index.php?showtopic=21832

    ' Standard housekeeping
    Dim i, objFile, objFSO, objHTTP, strFile, strMsg
    Const ForReading = 1, ForWriting = 2, ForAppending = 8

    ' Create a File System Object
    Set objFSO = CreateObject( "Scripting.FileSystemObject" )

    ' Check if the specified target file or folder exists,
    ' and build the fully qualified path of the target file
    If objFSO.FolderExists( myPath ) Then
        strFile = objFSO.BuildPath( myPath, Mid( myURL, InStrRev( myURL, "/" ) + 1 ) )
    ElseIf objFSO.FolderExists( Left( myPath, InStrRev( myPath, "\" ) - 1 ) ) Then
        strFile = myPath
    Else
        WScript.Echo "ERROR: Target folder not found."
        Exit Sub
    End If

    ' Create or open the target file
    Set objFile = objFSO.OpenTextFile( strFile, ForWriting, True )

    ' Create an HTTP object
    Set objHTTP = CreateObject( "WinHttp.WinHttpRequest.5.1" )

    ' Download the specified URL
    objHTTP.Open "GET", myURL, False
    objHTTP.Send

    ' Write the downloaded byte stream to the target file
    For i = 1 To LenB( objHTTP.ResponseBody )
        objFile.Write Chr( AscB( MidB( objHTTP.ResponseBody, i, 1 ) ) )
    Next

    ' Close the target file
    objFile.Close( )
End Sub



response write in file

URL ="http://code.google.com/p/cental-desktop-managment/"
Wscript.Echo "" & URL
down_http="down_http"
Set WshShell = WScript.CreateObject("WScript.Shell")
dim fso : set fso = createobject ("scripting.filesystemobject")
dim newfile : set newfile = fso.createtextfile(down_http, true)


Set http = CreateObject("MSXML2.XmlHttp")
http.open "GET", URL , FALSE
http.setRequestHeader "Content-Type","'application/soap+xml; charset=utf-8"
http.setRequestHeader "Content-Length", "255"
'data=http.setRequestHeader( "vipul", "Value" )
http.send ""
Wscript.Echo "http readyState" & http.readyState
Wscript.Echo "http status " & http.status
Wscript.Echo "http response " & http.responseText
newfile.write (http.responseText)
newfile.close